#ifndef JTOUCHDATETIMEEDIT_H
#define JTOUCHDATETIMEEDIT_H

#include <QTEGui/qteguiglobal.h>
#include <QDateTime>
#include <QFrame>

namespace QTE
{

class JTouchDateTimeEditPrivate;

class QTEGUI_EXPORT JTouchDateTimeEdit : public QFrame
{
	Q_OBJECT
    Q_PROPERTY(QDateTime datetime READ datetime WRITE setDateTime NOTIFY dateTimeChanged)

public:
	enum ShowFlag
	{
		Year    = 0x01,
		Month   = 0x02,
		Day     = 0x04,
		Date    = Year | Month | Day,
		Hour    = 0x08,
		Minute  = 0x10,
		Second  = 0x20,
		Time    = Hour | Minute | Second,
		All     = Date | Time,
		MSecond = 0x40,
	};
	Q_DECLARE_FLAGS(ShowFlags, ShowFlag)

public:
	explicit JTouchDateTimeEdit(QWidget *parent, ShowFlags flag = All);
	explicit JTouchDateTimeEdit(ShowFlags flag = All);
	~JTouchDateTimeEdit();

public:
	void setShowFlags(ShowFlags flags);
	ShowFlags setShowFlags() const;

public:
	QDateTime datetime() const;
	QDate date() const;
	QTime time() const;
	bool gestureEnabled() const;

public Q_SLOTS:
	void setDateTime(const QDateTime &datetime);
	void setDate(const QDate &date);
	void setTime(const QTime &time);
	void setGestureEnabled(bool enable);

Q_SIGNALS:
    void dateTimeChanged(const QDateTime &datetime);

private:
	JTouchDateTimeEditPrivate *d_ptr;
	Q_DISABLE_COPY(JTouchDateTimeEdit)
};

Q_DECLARE_OPERATORS_FOR_FLAGS(JTouchDateTimeEdit::ShowFlags)

} //namespace QTE


#endif //JTOUCHDATETIMEEDIT_H
